package com.gears_software.sxdc.dccx.ui.view;

import android.content.Context;

import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.gears_software.sxdc.dccx.R;
import com.gears_software.sxdc.dccx.application.DCCXApplication;
import com.gears_software.sxdc.dccx.data.model.RidingInformation;
import com.gears_software.sxdc.dccx.ui.activity.TripInformationActivity;

import net.cachapa.expandablelayout.ExpandableLayout;

import org.androidannotations.annotations.App;
import org.androidannotations.annotations.Click;
import org.androidannotations.annotations.EViewGroup;
import org.androidannotations.annotations.ViewById;

/**
 * Created by SunMuran on 2017/7/29.
 */
@EViewGroup(R.layout.item_trip_information)
public class TripInformationItemView extends LinearLayout {
    Context context;
    @App
    DCCXApplication app;
    @ViewById
    TextView tv_phone_number;
    @ViewById
    TextView tv_go_off;
    @ViewById
    TextView tv_reserve_seat;
    @ViewById
    TextView tv_entruching_point;
    @ViewById
    TextView tv_remarks;
    @ViewById
    TextView tv_xiajiantou;
    @ViewById
    ExpandableLayout expandable_layout;
    @ViewById
    RelativeLayout re_header;
    @ViewById
    LinearLayout ll_linearLayout;
    @ViewById
    TextView txt_time;
    @ViewById
    TextView txt_didian;
    @ViewById
    TextView txt_remark;
    int position;
    ListView listView;


    public TripInformationItemView(Context context) {
        super(context);
        this.context = context;
    }

    public void bind(RidingInformation ridingInformation, int position, ListView listView) {
        this.position = position;
        this.listView = listView;
        txt_time.setTypeface(app.iconfont);
        txt_didian.setTypeface(app.iconfont);
        txt_remark.setTypeface(app.iconfont);
        tv_xiajiantou.setTypeface(app.iconfont);
        tv_phone_number.setText(ridingInformation.getPhone_number());
        tv_go_off.setText(ridingInformation.getGo_off());
        tv_reserve_seat.setText(ridingInformation.getReserve_seat());
        tv_entruching_point.setText(ridingInformation.getEntruching_point());
        tv_remarks.setText(ridingInformation.getRemarks());

        re_header.setSelected(false);
        expandable_layout.collapse();

    }


}
